
{[include file="mold/mold/_view.tpl"]}

<fieldset>
<legend>生产计划</legend>
<form id="form_edit">
<input type="hidden" name="id" value="{[$result.id]}" />
  <table>
	<tr>
		<td width="20%" align="right">工件：</td>
		<td width="30%">{[$result.piece]}</td>
		<td width="20%" align="right">状态：</td>
		<td width="30%">{[$result.status_t]}</td>			
	</tr>
	<tr>
		<td align="right">工艺：</td>
		<td>{[$result.technics]}</td>
		<td align="right">负责人：</td>
		<td>{[$result.emp_t]}</td>
	</tr>
	<tr>
		<td align="right">备注：</td>
		<td colspan="3">{[$result.content|nl2br]}</td>
	</tr>
	{[if $result.reason ne '']}
	<tr>
		<td align="right">变更原因：</td>
		<td colspan="3">{[$result.reason|nl2br]}</td>
	</tr>
	{[/if]}
	<tr>
		<td align="right">计划时间：</td>
		<td>{[$result.t1]} 至 {[$result.t2]}</td>
		<td align="right">创建时间：</td>
		<td>{[$result.createtime]}</td>			
	</tr>
	<tr>
		<td align="right">计划工时：</td>
		<td>{[$result.hour]}小时{[$result.minute]}分钟</td>
		<td align="right">更新时间：</td>
		<td>{[$result.modifytime]}</td>
	</tr>
	{[if ($result.emp eq $smarty.session.id or $smarty.session.code eq 'admin') and $result.status lt 9]}
	<tr>
		<td align="right"></td>
		<td colspan="3">
		<input type="hidden" name="barcode" id="barcode" value="1" />
		{[if $result.status eq 1 and $status eq '2']}
		<input type="button" value="开始生产" name="B1" onclick="bar_start('{[$p2]}', {[$result.id]}); return false;">
		{[/if]}

		{[if $result.status eq 2 and $status eq '3']}
		<input type="button" value="完成生产" name="B2" onclick="bar_produce({[$result.id]}); return false;">		  
		{[/if]}

		{[if $result.status eq 3 and $status eq '2']}
		<input type="button" value="继续生产" name="B3" onclick="bar_continue('{[$p2]}', {[$result.id]}); return false;">
		{[/if]}

		{[if $result.status eq 2 and $status eq '2']}
		<input type="button" value="暂停生产" name="B4" onclick="bar_stop({[$result.id]}); return false;">
		{[/if]}

		{[if $result.status ne 9]}
		<input type="button" value="取消生产" name="B5" onclick="bar_cancel({[$result.id]}); return false;">
		{[/if]}
		</td>
	</tr>
	{[/if]}
  </table>
</form>
</fieldset>

{[if $produce]}
<fieldset>
<legend>生产信息</legend>
  <table>
	<tr>
		<td width="20%" align="right">工件：</td>
		<td width="30%">{[$produce.piece]}</td>
		<td width="20%" align="right">状态：</td>
		<td width="30%">{[$produce.status_t]}</td>			
	</tr>
	<tr>
		<td align="right">工艺：</td>
		<td>{[$produce.technics]}</td>
		<td align="right">负责人：</td>
		<td>{[$produce.emp_t]}</td>
	</tr>
	{[if $produce.filename ne '']}
	<tr>
		<td align="right">附件：</td>
		<td colspan="3"><a href="{[$produce.file]}" target="_blank">[下载]</a></td>
	</tr>
	{[/if]}
	<tr>
		<td align="right">工作内容：</td>
		<td colspan="3">{[$produce.content|nl2br]}</td>
	</tr>
	<tr>
		<td align="right">实际日期：</td>
		<td>{[$produce.t1]} 至 {[$produce.t2]}</td>
		<td align="right">创建时间：</td>
		<td>{[$produce.createtime]}</td>
	</tr>
	<tr>
		<td align="right">实现工时：</td>
		<td>{[$produce.hour]}小时{[$produce.minute]}分钟</td>
		<td align="right">更新时间：</td>
	  <td>{[$produce.modifytime]} </td>
	</tr>
  </table>
</fieldset>
{[/if]}

<script type="text/javascript" src="js/mold/plan/list.js?r={[$smarty.now]}"></script>